import React from 'react'
import {Modal,Form,Input} from 'antd'
const FormItem = Form.Item;
const { TextArea } = Input;
const formItemLayout = {
    labelCol: {
        span: 8,
    },
    wrapperCol: {
        span: 14,
    }
};

class AddNoticeModal extends React.Component{
    render(){
        const {visible,onOk,onCancel,form,data} = this.props;
        const { getFieldDecorator } = form;
        return (
            <div>
                <Modal
                    title="新增通知"
                    visible={visible}
                    onOk={onOk}
                    onCancel={onCancel}
                    okText="确认"
                    cancelText="取消"
                >
                    <Form>
                        <FormItem label="通知标题" {...formItemLayout}>
                            {getFieldDecorator('republicName', {
                                initialValue: data.republicName,
                                rules: [
                                    { required: true, message: '通知标题不能为空' },
                                ],
                            })(
                                <Input placeholder='请输入通知标题'/>
                            )}
                        </FormItem>
                        <FormItem label="通知内容" {...formItemLayout}>
                            {getFieldDecorator('republicContent', {
                                initialValue: data.republicContent,
                                rules: [
                                    { required: true, message: '通知内容不能为空' },
                                ],
                            })(
                                <TextArea rows={18} placeholder="请输入通知内容" />
                            )}
                        </FormItem>
                    </Form>
                </Modal>
            </div>
        )
    }
}
export default Form.create()(AddNoticeModal)